<template>
  <div style="position: relative;display: inline-block;">
    <button>東山木</button>
  </div>
</template>

<script setup lang='ts'>
import { } from 'vue'

</script>
<style scoped>
button {
  /* 设置了position：absolute后元素的display就自动变为display:inline-block */
  border: none;
  text-decoration: none;
  font-family: sans-serif;
  color: #fff;
  width: 200px;
  height: 60px;
  /* border: 2px solid violet; */
  box-sizing: border-box;
  border-radius: 30px;
  text-align: center;
  line-height: 60px;
  font-size: 24px;
  background-size: 400%;
  background-image: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
  z-index: 1;
}

@keyframes btn {
  0% {
    background-postion: 0;
  }

  100% {
    background-position: 400%;
  }
}

button:hover {
  animation: btn 8s linear infinite;
}

button::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 40px;
  z-index: -1;
  background-size: 400%;
  background-image: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
  /* filter: blur(20px); */
  opacity: 0;
  transition: 0.5s;
}

button:hover::before {
  animation: btn 8s linear infinite;
  filter: blur(20px);
  opacity: 1;
}
</style>